package com.ekingstar.lss.commons.supper.utils.query.simple;

import com.ekingstar.lss.commons.supper.utils.query.LssTarget;

/**
 *	公司：金仕达多媒体
 *	作者：童弘成
 *	时间：2011-5-19 下午07:56:06
 *	描述：实体对象描述简单实现
 */
public class SimpleTarget implements LssTarget {
	
	private String target;
	
	private String targetName;

	public SimpleTarget(){}
	
	public SimpleTarget(String content){
		content=content.replaceAll("\\s+", " ").trim()+" ";
		if(content.indexOf(" as ")!=-1){
			String [] targets=content.split(" as ");
			System.out.println("ffffffffffff  "+targets[0]);
			this.target=targets[0].replaceAll(" ", "");
			if(targets.length>1&&!"".equals(targets[1])){
				this.targetName=targets[1].replaceAll(" ", "");;
			}else{
				this.targetName=this.target+"_";
			}
			
		}else{
			this.target=content.replaceAll(" ", "");
			this.targetName=this.target+"_";
		}
	}
	
	public String getTarget() {
		// TODO Auto-generated method stub
		return this.target;
	}

	public String getTargetName() {
		// TODO Auto-generated method stub
		return this.targetName;
	}

}
